package com.mingqijia.gassafety.shared.constant;


import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;

@Getter
@RequiredArgsConstructor
public enum CustStatusEnum {
//     X:销户, A:运行, B:预销,C:非激活,P:报停, I:临时,E:作废,99:未知,ENA:未报装
    STATUS_1("X","销户"),
    STATUS_2("A","运行"),
    STATUS_3("B","预销"),
    STATUS_4("C","非激活"),
    STATUS_5("P","报停"),
    STATUS_6("I","临时"),
    STATUS_7("E","作废"),
    STATUS_8("99","未知"),
    STATUS_9("ENA","未报装");

    private final String status;
    private final String name;

    public static String getCustStatusName(String status){
        if (StringUtils.isBlank(status)) {
            return null;
        }
        for (CustStatusEnum statusEnum : CustStatusEnum.values()) {
            if (statusEnum.status.equalsIgnoreCase(status)) {
                return statusEnum.name;
            }
        }
        return "";
    }
}
